<div class="col-md-12 col-sm-12 col-xs-12" v-cloak id="updatePageController" style="margin-top:10px;">
    <div class="x_panel">
        <div class="x_title">
            <h2 style="width:300px;">
                编辑问题
                <small></small>
            </h2>
            <ul class="nav navbar-right panel_toolbox"></ul>
            <div class="clearfix"></div>
        </div>
        <div class="x_content">
            <br />
            <form class="form-horizontal form-label-left" id="validate">
                <div class="form-group">
                    <label class="control-label col-md-3 col-sm-3 col-xs-12">
                        问题
                        <span class="required" style="color:red;">*</span>
                    </label>
                    <div class="col-md-6 col-sm-6 col-xs-12">
                        <input type="text" name="name" required="required" class="form-control  col-md-7 col-xs-12" v-model="entity.examinationQuestions">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-3 col-sm-3 col-xs-12">
                        分数
                        <span class="required" style="color:red;">*</span>
                    </label>
                    <div class="col-md-6 col-sm-6 col-xs-12">
                        <input type="text" name="name" required="required" class="form-control  col-md-7 col-xs-12" v-model="entity.mark">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-3 col-sm-3 col-xs-12">
                        问题类型
                        <span class="required" style="color:red;">*</span>
                    </label>
                    <div class="col-md-6 col-sm-6 col-xs-12">
                        <select class="select2 form-control  col-md-7 col-xs-12" required="required" v-model="entity.questionType" v-on:change="changeQuestionType">
                            <option v-for='item in questionTypes' v-bind:value='item'>
                                {{item=='SingleChoiceQuestion'?'单选题':(item=='MultipleChoiceQuestion'?'多选题':(item=='JudgmentQuestion'?'判断题':'简答题'))}}
                            </option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-3 col-sm-3 col-xs-12">
                        科目类型
                        <span class="required" style="color:red;">*</span>
                    </label>
                    <div class="col-md-6  col-sm-6 col-xs-12">
                        <select class="select2 form-control  col-md-7 col-xs-12" required="required" v-model="entity.subjectId">
                            <option v-for='item in subjects' v-bind:value='item.id'>
                                {{item.name}}
                            </option>
                        </select>
                    </div>
                </div>
                <div class="form-group" v-if="'ShortAnswerQuestion'!=entity.questionType">
                    <label class="control-label col-md-3 col-sm-3 col-xs-12">
                        选项
                        <span class="required" style="color:red;">*</span>
                    </label>
                    <div class="col-md-6  col-sm-6 col-xs-12">
                        <table class="table table-striped table-bordered">
                            <thead>
                                <tr>
                                    <th>
                                        <a href="javascript:;" v-on:click="addAnswer()">
                                            <i class="fa fa-plus"></i>
                                        </a>
                                    </th>
                                    <th>是否正确答案</th>
                                    <th>选项</th>
                                    <th>选项详情</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="(item,index) in entity.answers">
                                    <td>
                                        {{index+1}}
                                    </td>
                                    <td>
                                        <input class="icheck" type="checkbox" v-model='item.rightAnswer' />
                                    </td>
                                    <td>
                                        <input v-model="item.answerDescription" type="text" class="form-control" />
                                    </td>
                                    <td>
                                        <input v-model="item.alias" type="text" class="form-control" />
                                    </td>
                                    <td>
                                        <button class="btn btn-primary" type="button" v-on:click="deleteAnswer(index)">删除</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                        <button type="button" class="btn btn-success" v-on:click="save()">确认</button>
                        <button class="btn btn-primary" type="button" v-on:click="close()">关闭</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script page-script="./dist/js/QuestionPage/editPage.js">
</script>